package com.project.im.common.exception;

import com.project.im.common.enums.ResponseCode;
import lombok.Getter;
import org.springframework.security.core.AuthenticationException;

@Getter
public class WebAuthenticationException extends AuthenticationException {

    private final String code;

    public WebAuthenticationException(String code, String msg) {
        super(msg);
        this.code = code;
    }

    public WebAuthenticationException(ResponseCode responseCode) {
        super(responseCode.getMsg());
        this.code = responseCode.getCode();
    }
}
